﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
namespace AgileLogistics.ViewModel
{
    public class BaseViewModel : ViewModelBase
    {


        private RelayCommand<string> menusChangeCommand => new Lazy<RelayCommand<string>>(() => new RelayCommand<string>(MenuChangeFunc)).Value;

        //private RelayCommand<string> menuChange => new Lazy<RelayCommand<string>>(() => new RelayCommand<string>(MenuChangeFunc)).Value;
        public RelayCommand<string> MenusChangeCommand
        {
            get
            {
                return menusChangeCommand;
            }

        }

        private void MenuChangeFunc(string MenuHeader)
        {
            Page page = new Page();
            switch (MenuHeader)
            {
                default:
                    break;
                case "部门管理":
                    page = new View.User.Dep.Page_List();
                    break;
                case "用户类型":
                    page = new View.User.Role.Page_List();
                    break;
                case "用户管理":
                    page = new View.User.Page_List();
                    break;
            }

            GalaSoft.MvvmLight.Messaging.Messenger.Default.Send<Page>(page, "MenuChangePage");
        }



        #region 部门管理
        public Model.Depment CurrDep { get; set; }
        public List<Model.Depment> DepList { get; set; }
        #endregion



        #region 角色管理
        public Model.Roles CurrRole { get; set; }
        public List<Model.Roles> RoleList { get; set; }
        #endregion



        #region 权限管理

        public List<Model.Permission> Permissions  {get;set;}

        public Model.Permission CurrPerm { get; set; }
        #endregion
    }
}
